package cn.hznc.domain.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @Author：Administrator
 * @Date：2023/4/21 9:55
 */
@Getter
@Setter
@Table(name = "t_machine_tool_task")
@TableName(value = "t_machine_tool_task")
public class MachineToolTaskEntity{

    /**
     * 主键
     */
    @Column(name = "id",type = MySqlTypeConstant.INT,length = 11,isKey = true,isAutoIncrement = true)
    @TableId(type = IdType.AUTO)
    private Integer id;


    /**
     * 工序序列号
     */
    @Column(name = "order_snapshot_craft_seq",type = MySqlTypeConstant.INT,length = 5)
    @TableField("order_snapshot_craft_seq")
    private Integer orderSnapshotCraftSeq;

    /**
     * 对应工单快照id主键
     */
    @Column(name = "order_task_id",type = MySqlTypeConstant.VARCHAR,length = 200)
    @TableField("order_task_id")
    private String orderTaskId;

    /**
     * 机床主键
     */
    @Column(name = "machine_tool_id",type = MySqlTypeConstant.INT,length = 11)
    @TableField("machine_tool_id")
    private Integer machineToolId;

    /**
     * 机床名称
     */
    @Column(name = "machine_tool_name",type = MySqlTypeConstant.VARCHAR,length = 100)
    @TableField("machine_tool_name")
    private String machineToolName;

    /**
     * 机床负责人
     */
    @Column(name = "operator",type = MySqlTypeConstant.VARCHAR,length = 100)
    @TableField("operator")
    private String operator;

    /**
     * 数量
     */
    @Column(name = "number",type = MySqlTypeConstant.INT,length = 5)
    @TableField("number")
    private Integer number;

    /**
     * 创建时间
     */
    @Column(name = "create_time",type = MySqlTypeConstant.DATETIME)
    @TableField("create_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 开始时间
     */
    @Column(name = "start_time",type = MySqlTypeConstant.DATETIME)
    @TableField("start_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;

    /**
     * 结束时间
     */
    @Column(name = "end_time",type = MySqlTypeConstant.DATETIME)
    @TableField("end_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;

//    /**
//     * 修改时间
//     */
//    @Column(name = "update_time",type = MySqlTypeConstant.DATETIME)
//    @TableField("update_time")
//    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
//    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
//    private Date updateTime;


    /**
     * 是否完成
     */
    @Column(name = "is_done",type = MySqlTypeConstant.TINYINT)
    @TableField("is_done")
    private Integer isDone;

    /**
     * 任务时长
     */
    @Column(name = "handle_time",type = MySqlTypeConstant.DECIMAL)
    @TableField("handle_time")
    private BigDecimal handleTime;

    /**
     * 人员编号
     */
    @Column(name = "employee_no",type = MySqlTypeConstant.VARCHAR , length = 100)
    @TableField("employee_no")
    private String employeeNo;

    /**
     * 人员姓名
     */
    @Column(name = "employee_name",type = MySqlTypeConstant.VARCHAR , length = 100)
    @TableField("employee_name")
    private String employeeName;

    /**
     * 单件耗时
     */
    @TableField(exist = false)
    private BigDecimal singleTimeConsuming;

    /**
     * 人员id
     */
    @TableField(exist = false)
    private Integer employeeId;

    /**
     * 人员id
     */
    @Column(name = "craft_name",type = MySqlTypeConstant.VARCHAR , length = 100)
    @TableField("craft_name")
    private String craftName;

    /**
     * 时间开始时间
     */
    @Column(name = "actual_start_time",type = MySqlTypeConstant.DATETIME)
    @TableField("actual_start_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date actualStartTime;

    /**
     * 时间结束时间
     */
    @Column(name = "actual_end_time",type = MySqlTypeConstant.VARCHAR)
    @TableField("actual_end_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date actualEndTime;

    /**
     * 时间结束时间
     */
    @Column(name = "content",type = MySqlTypeConstant.VARCHAR , length = 150)
    @TableField("content")
    private String content;


    /**
     * 任务缺失程序状态
     */
    @TableField(exist = false)
    private Integer satisfied_status;

}
